package cn01;

//遍历字符串

import java.util.Scanner;

public class test07 {
    public static void main(String[] args) {
        Scanner sc  = new Scanner(System.in);
        System.out.println("请输入一个字符串：");
        String line = sc.nextLine();

        for (int i = 0; i < line.length(); i++) {
            char c = line.charAt(i);
            System.out.println(c);
        }
        System.out.println("...........");

        char[] chars = line.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            System.out.println(chars[i]);
        }
    }
}
